/** PatientInformation JUnit test class */
package edu.gatech.tests;

import edu.gatech.datastorage.PatientInformation;
import edu.gatech.datastorage.TreatmentRecord;
import junit.framework.TestCase;

/**
 * Tests the PatientInformation class
 * 
 * @author Courtney Smith
 * @version 1.0
 */
public class PatientInformationTest extends TestCase {
	
	/**
	 * Tests the getLastRecord() method
	 */
	public void testGetLastRecord(){
		
		final PatientInformation info = new PatientInformation("test", "pass");
		// history should be empty and null should be returned
		assertTrue("history is not empty when it should", 
					info.getLastRecord() == null);
		
		final TreatmentRecord r1 = new TreatmentRecord("cold", "yesterday", 
														"morning", "Dr. Who");
		final TreatmentRecord r2 = new TreatmentRecord("cancer", "today", 
														"afternoon", "Dr. Who");
		final TreatmentRecord r3 = new TreatmentRecord("death", "tomorrow", 
														"evening", "Dr. Who");
		info.addRecord(r1);
		info.addRecord(r2);
		info.addRecord(r3);
		// history should contain three TreatmentRecord with r3 being the last one
		// verify r3 is the one returned
		assertTrue("last record does not equal the correct last record r3", 
				info.getLastRecord().equals(r3));
//		assertFalse("last record is r1 when it should be r3", 
//					info.getLastRecord().equals(r1));
//		assertFalse("last record is r2 when it should be r3", 
//					info.getLastRecord().equals(r2));
	}
}
